package com.cuit.utils;

import com.google.common.hash.HashCode;
import com.google.common.hash.HashFunction;
import com.google.common.hash.Hashing;

import java.nio.charset.Charset;

/**
 * @author chishuiLi     Email:1192537447@qq.com
 * @Description
 */
public class HashUtils {
    private static final HashFunction FUNCTION = Hashing.md5();

    //定义一个盐
    private static final String SALT = "cuit";

    public static String encryPassword(String password){
        HashCode hashCode = FUNCTION.hashString(password+SALT, Charset.forName("UTF-8"));
        return hashCode.toString();
    }

//    public static void main(String[] args) {
//        String s = encryPassword("123456");
//        System.out.println(s);
//    }
}
